import axios from "axios";

export function request(config) {
  const instance = axios.create({
    baseURL: 'http://localhost:8081/api/v1/ops',
    timeOut: 5000,
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Headers': 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With, Current-Page',
      'Access-Control-Allow-Methods': 'PUT, POST, GET, DELETE, OPTIONS'
    }
  })

  instance.interceptors.request.use(config => {
    return config;
  },err =>{
    console.log(err);
  })

  return instance(config);
}
